﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _3._1_Shuixianhua
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            label2.Text = "";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int num, gw, sw, bw;
            num = int.Parse(textBox1.Text);
            gw = num % 10;
            sw = num / 10 % 10;
            bw = num / 100;
            if (Math.Pow(gw,3)+Math.Pow(sw,3)+Math.Pow(bw,3)==num)
            {
                label2.Text=num+"是水仙花数";
            }else{
                 label2.Text=num+"不是水仙花数";
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label2.Text = "";
            textBox1.Text = "";
        }
    }
}
